package com.wedimob.boxinternetprotection.freebox;

public enum ClientFilterType {
    NONE("disabled"),
    WHITE_LIST("whitelist"),
    BLACK_LIST("blacklist");

    private String code;

    private ClientFilterType(String code) {
        this.code = code;
    }

    public String getCode() {
        return code;
    }

    static ClientFilterType createFromCode(String code) {
        for (ClientFilterType type : ClientFilterType.values()) {
            if (type.getCode().equals(code))
                return type;
        }
        throw new RuntimeException(code + " is not valid");
    }
}
